function check_template_multiTime(ExpGroup)
adata_dir = '\\argon.fmi.ch\keller.g\AData\';
template_arr={};
for gnd=1:length(ExpGroup)
    display(['Loading experiment ' num2str(ExpGroup(gnd))])
    [adata_file,mouse_id,userID]=find_adata_file(ExpGroup(gnd),adata_dir);
    orig=load([adata_dir userID '\' mouse_id '\' adata_file],'template');
    for tnd=1:length(orig.template)
        template_arr{gnd,tnd}=orig.template{tnd};
    end
end

if length(ExpGroup)>4
    x=4;
    y=2;
else
    x=length(ExpGroup);
    y=1;
end

save_dir='C:\Data\zmarpawe\templates';

% for und=1:size(template_arr,2)
%     h = figure;
%     set(gcf,'Position',[1          41        1600         784])
%     for dnd=1:length(ExpGroup)
%         subplot(y,x,dnd)
%         imagesc(template_arr{dnd,und})
%         colormap gray
%         set(gca,'clim',[400 4000])
%         axis off
%         box off
%     end
% end
fname=[num2str(ExpGroup(1)) '_ExpGroup'];
if ~isdir([save_dir '\' fname])
    mkdir(save_dir,fname);
end

for und=1:size(template_arr,2)
    fname2=['L' num2str(und)];
    if ~isdir([save_dir '\' fname '\' fname2])
        mkdir([save_dir '\' fname],fname2);
    end
    for gnd=1:size(template_arr,1)
        fname3=[save_dir '\' fname '\' fname2 '\' num2str(ExpGroup(gnd)) '_' fname2];
        h=figure('Visible','off');
        imagesc(template_arr{gnd,und})
        colormap gray
        set(gca,'clim',[400 4000])
        axis off
        box off
        print(h,'-deps',fname3)
    end
end
